import request from '@/util/request'
export default {
    findAll(){
        return request({
            url: '/user/list',
            method: 'get',
        })
    },
    // 1. 查询所有用户
    findUsers() {
        return request({
            url: '/user/list',
            method: 'get',
        })
    },
    // 2. 分页查询用户
    findByPage(page, pageSize) {
        return request({
            url: `/user/findByPage/${page}/${pageSize}`,
            method: 'get',
        })
    },
    //3. 条件查询分页
    search(page,pageSize,data){
        return request({
            url: `/user/search/${page}/${pageSize}`,
            method: 'post',
            data
        })
    },
    save(data){
        return request({
            url: `/user/save`,
            method: 'post',
            data
        })
    },
    update(data) {
              return request({
                  url: `/user/update`,
                  method: 'put',
                  data
              })
          },
    delete(ids) {
            return request({
                url: `/user/delete/${ids}`,
                method: 'delete'
            })
        }
}